1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and an image forming apparatus suitable to rotate image data 180 degrees and output the image data.
2. Description of the Related Art
An image forming apparatus, such as a printer, temporarily stores image data in a memory. In this case, when the image data is stored in the memory without any change, a high-capacity memory is needed, which results in an increase in cost. In order to solve this problem, the image data is compressed and is then stored in the memory.
For example, a print process of the printer is performed as follows. The printer receives a page description language (PDL) which is created by, for example, a computer through a network and analyzes the PDL to generate an intermediate language that can be executed by a drawing unit. A drawing unit analyzes the intermediate language and draws an image subjected to gradation processing to a band memory. The drawn image data is compressed and coded by a binary image compression coding algorithm, and the generated code data is stored in the memory. Thereafter, during a print operation, the code data is read from the memory while being delayed for each of C, M, Y, and K and the read code data is decoded. Then, the data corresponding to each of C, M, Y, and K is transmitted to the printer engine and is then printed.
In addition, a printer capable of performing printing on both surfaces of a sheet has been known. When performing printing on the rear surface of the sheet, the printer can print image data that is rotated 180 degrees with respect to the original image data on the rear surface reversed to the printed front surface of the sheet.
In the related art, when it is necessary to rotate image data 180 degrees and output the image data in the reverse order, as in double-side printing, code data obtained by compressing and coding the image data is expanded on the memory and then the expanded data is read in the reverse order. Therefore, a memory space with a size more than that of the code data is needed in order to decode the compressed and coded code data and expand the decoded data. In addition, an operation of writing the expanded data to the memory and an operation of reading the data from the memory are needed, resulting in a low processing speed.
In order to solve the above-mentioned problems, for example, Japanese Patent Application Laid-open No. 08-317225 discloses an image data compressing/decompressing device that divides image data corresponding to one page into a plurality of rectangular blocks, compresses each divided block, and manages data. Japanese Patent No. 3437346 discloses a technique that codes image data for every N×N blocks and manages the code length of the coded data for each block. In this way, it is possible to manage a variable-length code and perform a memory access to each block code. Therefore, it is possible to rotate the image data in a 90-degrees unit.
Japanese Patent Application Laid-open No. 2001-197496 discloses a technique that compresses codes for every N×N blocks, calculates a code length for each block, and manages the codes in a block line unit. In this way, it is possible to manage a variable-length code and perform a memory access to each block code. Therefore, it is possible to rotate data in a 90-degrees unit.
Japanese Patent Application Laid-open No. 2007-214802 discloses a technique that individually performs a decoding process of obtaining image data 802 which is rotated 0 degrees with respect to a code 801 obtained by coding image data 800 and a decoding process of obtaining image data 803 which is rotated 180 degrees with respect to the code 801, as shown in FIG. 50, in order to increase the print speed during double-side printing and reduce a memory space used. According to Japanese Patent Application Laid-open No. 2007-214802, as shown in FIG. 51, during coding, the image data 800 is coded in a line unit to generate a code 801′. During decoding, the code 801′ is decoded from the last line to create an intermediate image 804 that is reversed in the vertical direction. In addition, the image is reversed in the horizontal direction to obtain the image data 803 that is rotated 180 degrees with respect to the image data 800.
Japanese Patent No. 4131977 discloses a coding method capable of decoding a code in both the forward direction and the reverse direction. In particular, Japanese Patent No. 4131977 is used to compress and code moving picture data. When a code is received by radio waves, such as television broadcast signals, a large loss of codes occurs. For example, when an error occurs due to the damage of codes during the decoding of image data in the forward direction, decoding is performed from the rear side of the code to a portion that is not damaged. In this way, the deterioration of image quality is prevented.
Japanese Patent Application Laid-open No. 2002-200792 discloses a non-stack-type double-side printing method. In the non-stack type, after the front surface is printed, a reversing device reverses the sheet and printing is performed on the rear surface of the sheet having the printed front surface. In this way, double-side printing is achieved.
Japanese Patent No. 2888186 discloses a compression scheme using a predictive coding method that predicts the value of a pixel of interest from peripheral pixels using a prediction expression.
However, in recent years, printers having a structure in which image data is transmitted through an internal bus have been generally used. FIG. 52 shows the structure of an example of a printer 500 according to the related art in which image data is transmitted through an internal bus.
The printer 500 includes a central processing unit (CPU) section provided with a memory controller, an image processing Application Specific Integrated Circuit (ASIC), a panel controller ASIC, a main memory 630, and a ROM 640 storing programs.
The CPU section provided with a memory controller includes a CPU 600, a CPU I/F 601, a memory arbiter (ARB) 602, a memory controller 603, a direct memory access (DMA) controller 604, a bus controller 605, and a communication controller 606. The CPU section provided with a memory controller, the image processing ASIC, and the panel controller ASIC can communicate with one another through a bus 613. The communication controller 606 communicates with, for example, a computer (PC) 650 through a network.
The memory arbiter 602 arbitrates an access between the main memory 630 and each unit of the CPU section provided with a memory controller. The communication controller 606 controls communication through, for example, a network. The bus controller 605 arbitrates connection between each unit and the bus 613. The memory controller 603 controls an access to the main memory 630. The CPU I/F 601 controls communication between the memory arbiter 602 and the CPU 600.
The main memory 630 includes a page description language (PDL) data area 630A, an image data area 630B, a rotated image data area 630C, and a page code data area 630D.
The image processing ASIC includes a bus I/F 607, a coding unit 608, a decoding unit 609, an engine controller 610, and a rotating unit 700. The bus I/F 607 controls communication between the bus 613 and the image processing ASIC. The coding unit 608 compresses and codes image data stored in the image data area 630B of the main memory 630. The decoding unit 609 decodes a page code stored in the page code data area 630D of the main memory 630. The rotating unit 700 rotates the image data 180 degrees. The engine controller 610 controls a printer engine 660.
The panel controller ASIC includes a bus I/F 611 and a panel controller 612. The bus I/F 611 controls communication between the bus 613 and the panel controller ASIC. The panel controller 612 controls an operation panel 621.
Next, the flow of data during a 180-degree rotation process of the printer 500 shown in FIG. 52 will be described with reference to FIGS. 53 and 54. In FIG. 53, PDL data created by the computer 650 is stored in the PDL data area 630A of the main memory 630 through, for example, the memory arbiter 602 along a path A. As shown in a path B, the CPU 600 reads the PDL data from the PDL data area 630A of the main memory 630 through, for example, the memory arbiter 602. The CPU 600 analyzes the PDL data, draws image data, and stores the drawn image data in the image data area 630B of the main memory 630 along a path C.
The image data stored in the image data area 630B is read from the image data area 630B to be subjected to the 180-degree rotation process, and is supplied to the rotating unit 700 through the bus 613 along a path D. The rotating unit 700 rotates the image data 180 degrees. The rotated image data is supplied to the main memory 630 through the bus 613 along a path E and is then stored in the rotated image data area 630C. The rotated image data stored in the rotated image data area 630C is supplied to the coding unit 608 through the bus 613 along a path F. The rotated image data is coded by the coding unit, is supplied to the main memory 630 through the bus 613 along a path G, and is stored in the page code data area 630D.
Then, as shown in FIG. 54, the rotated image data subjected to path coding is read from the page code data area 630D of the main memory 630 and is supplied to the decoding unit 609 through the bus 613 along a path H. Then, the rotated image data is decoded by the decoding unit and is then supplied to the engine controller 610.
However, in Japanese Patent Application Laid-open No. 08-317225 and Japanese Patent No. 3437346, since the image data of one page is managed in a fine block unit, a large memory area for storing the address of each block is needed and the process becomes complicated. In addition, since the original image data is divided into fine blocks, the compression ratio is reduced.
In Japanese Patent Application Laid-open No. 2001-197496, it is necessary to store the addresses in a block line unit and a process of calculating the internal address of the block line code during rotation becomes complicated.
In Japanese Patent Application Laid-open No. 2007-214802, as shown in FIG. 55, the code length of each line is described as a line TAG at the end of line code data. During the 180-degree rotation process, the code length is read from the line TAG to calculate the address of a code at the head of the line. Then, the code of one line is sequentially read from the address and is then decoded. Therefore, a DMA that transmits codes serially reads codes corresponding to one line, and randomly access the addresses of the codes. Therefore, the efficiency of the DMA transmitting the codes is significantly reduced. As a result, the performance of a common bus or the memory access performance of the memory deteriorates.
In Japanese Patent No. 4131977, it is possible to decode the code in the reverse direction, but a code format capable of decoding the code in both the forward direction and the reverse direction is needed, which results in an increase in a code size and a low compression ratio.
The predictive coding method disclosed in Japanese Patent No. 2888186 predicts coding from peripheral pixels using the prediction expression and performs coding. Therefore, basically, it is difficult to decode codes in the reverse direction. This is because the peripheral pixels used for decoding have not been decoded during the decoding of the code in the reverse direction. As such, the image data coded by the predictive coding method can be decoded only in the forward direction in which the image data has been coded.
In the double-side printing system according to the related art shown in FIGS. 52 to 54, as shown in FIGS. 56A to 56C, when even-numbered pages are coded, a large amount of data is transmitted through the bus for a rotation process, and the print speed is reduced. In the example shown in FIGS. 56A to 56C, in the coding process, for the odd-numbered pages (the first page, the third page, and the fifth page), the amounts of data transmitted through the bus 613 are 192 MB, 256 MB, and 64 MB, respectively. For the even-numbered pages (the second page and the fourth page), the amounts of data transmitted through the bus 613 are 512 MB.